﻿/*------------------------------------------------
// File Description: AllocateOrder DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-03-09 16:29:29
//------------------------------------------------*/

using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 调拨单
    /// </summary>
    [Table(nameof(AllocateOrder))]
    public class AllocateOrder : BaseEntity
    {
        private string _allocateNo = string.Empty;
        private string _fromWarehouse = string.Empty;
        private string _toWarehouse = string.Empty;
        private string _remark = string.Empty;
        private string _toWarehouseCode;
        private string _fromWarehouseCode;
        private string _workOrderNo;
        private string _orderNo;

        #region Public Property

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 调拨单号
        ///</Summary>
        public string AllocateNo
        {
            get { return string.IsNullOrWhiteSpace(_allocateNo) ? string.Empty : _allocateNo; }
            set { _allocateNo = value; }
        }

        ///<Summary>
        /// 调拨单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        /// <summary>
        /// 发货仓编码
        /// </summary>
        public string FromWarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_fromWarehouseCode) ? string.Empty : _fromWarehouseCode; }
            set { _fromWarehouseCode = value; }
        }

        ///<Summary>
        /// 发货仓名称
        ///</Summary>
        public string FromWarehouse
        {
            get { return string.IsNullOrWhiteSpace(_fromWarehouse) ? string.Empty : _fromWarehouse; }
            set { _fromWarehouse = value; }
        }

        /// <summary>
        /// 接收仓编码
        /// </summary>
        public string ToWarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_toWarehouseCode) ? string.Empty : _toWarehouseCode; }
            set { _toWarehouseCode = value; }
        }

        ///<Summary>
        /// 接收仓名称
        ///</Summary>
        public string ToWarehouse
        {
            get { return string.IsNullOrWhiteSpace(_toWarehouse) ? string.Empty : _toWarehouse; }
            set { _toWarehouse = value; }
        }

        ///<Summary>
        /// 调拨时间
        ///</Summary>
        public DateTime AllocateTime { get; set; }

        ///<Summary>
        /// 备注
        ///</Summary>
        public string Remark
        {
            get { return string.IsNullOrWhiteSpace(_remark) ? string.Empty : _remark; }
            set { _remark = value; }
        }

        /// <summary>
        /// 审核人
        /// </summary>
        public int ReviewBy { get; set; }

        /// <summary>
        /// ERP审核时间
        /// </summary>
        public DateTime? ReviewTime { get; set; }

        /// <summary>
        /// ERP修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 批次号最后同步人
        /// </summary>
        public int BatchLastAsyncBy { get; set; }

        /// <summary>
        /// 批次号最后同步时间
        /// </summary>
        public DateTime? BatchLastAsyncTime { get; set; }

        /// <summary>
        /// 批次号同步完成
        /// </summary>
        public bool BatchAsyncFinished { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 调拨单
        /// </summary>
        public virtual DbSet<AllocateOrder> AllocateOrders { get; set; }
    }
}
